package com.careme.ucenter.controller;


import com.example.commonutils.R;
import com.careme.ucenter.entity.UserAccount;
import com.careme.ucenter.service.UserInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-05-16
 */
@RestController
@CrossOrigin
@RequestMapping("/ucenter/user-information")
public class UserInformationController {

    @Autowired
    private UserInformationService userInformationService;

    @PostMapping("login")
    public R login(@RequestBody UserAccount userAccount){

        String account = userAccount.getAccount();
        String password = userAccount.getPassword();
        if(account.equals("admin") && password.equals("admin")){
            return R.ok().data("status","0");
        }else if (account.equals("super") && password.equals("super")){
            return R.ok().data("status","1");
        }
        return R.error().message("账号或密码有误");
    }


}

